package com.xiaoq.matrix.minipro.service.impl;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.xiaoq.apis.minipro.IMiniproApi;
import com.xiaoq.apis.minipro.MiniProInfo4Vo;
import com.xiaoq.matrix.minipro.entity.ShopMiniProEntity;
import com.xiaoq.matrix.minipro.repository.impl.ShopMiniProRepositoryImpl;

@Service(interfaceClass =IMiniproApi.class,version= "1.0.0" )
public class MiniproApiDobboxImpl implements IMiniproApi {
	
	@Autowired
	private ShopMiniProRepositoryImpl shopMiniProRep;

	@Override
	public MiniProInfo4Vo getMiniProSecretByShopId(String shopId) {
		ShopMiniProEntity shopMiniPro = shopMiniProRep.getByShopId(shopId, "2");
		if(shopMiniPro!=null){
			MiniProInfo4Vo miniProInfo = new MiniProInfo4Vo();
			
			miniProInfo.setAppId(shopMiniPro.getAppId());
			miniProInfo.setAppSecret(shopMiniPro.getAppSecret());
			return miniProInfo;
		}else{
			return null;
		}
		
	}

}
